// Pie 盲猜一波二分
#include <bits/stdc++.h>
using namespace std;
const int N = 10010;
double pi = acos(-1);
double v[N];
int n, f;

bool check(double x) {
  int served = 0;
  for (int i = 0; i < n; ++i) {
    served += v[i] / x;
  }
  return served >= f + 1;  // 加上自己
}
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    cin >> n >> f;
    for (int i = 0; i < n; ++i) {
      double r;
      cin >> r;
      v[i] = r * r * pi;
    }
    double l = 0, r = 1e8 * pi;
    while (abs(r - l) > 1e-6) {
      double mid = (l + r) / 2;
      if (check(mid))
        l = mid;
      else
        r = mid;
    }
    printf("%.4lf\n", l);
  }
}
